import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'layout',
    redirect: '/home',
    component: () => import(/* webpackChunkName: "layout" */ '../views/layout/indexView.vue'),
    children: [{
      path: '/home',
      name: 'home',
      component: () => import(/* webpackChunkName: "home" */ '../views/home/indexView.vue'),
    },{
      path: '/classify',
      name: 'classify',
      component: () => import(/* webpackChunkName: "classify" */ '../views/classify/indexView.vue'),
    },{
      path: '/select/car',
      name: 'selectCar',
      component: () => import(/* webpackChunkName: "selectCar" */ '../views/selectCar/indexView.vue'),
    },{
      path: '/my',
      name: 'my',
      component: () => import(/* webpackChunkName: "my" */ '../views/my/indexView.vue')
    }]
  },
  {
    path: '/detail/:id',
    name: 'detail',
    component: () => import(/* webpackChunkName: "detail" */ '../views/detail/indexView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
